package com.ziyueyuwen.xiniao.dao;

import com.ziyueyuwen.xiniao.bean.ZyUser;
import com.ziyueyuwen.xiniao.bean.vo.ZyUserVO;
import com.ziyueyuwen.xiniao.enums.ClassUserTypeEnum;
import com.ziyueyuwen.xiniao.enums.StudentQueryEnum;
import com.ziyueyuwen.xiniao.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
/**
 * @author wancheng
 */
public interface ZyUserMapper extends BaseMapper<ZyUser>{
    /**
     * 获取用户信息
     * @param userAccount
     * @return
     */
    ZyUserVO getUserMessage(String userAccount);

    /**
     * 获取用户
     * @param userAccount
     * @return
     */
    ZyUser getByUserAccount(String userAccount);

    /**
     * 获取用户
     * @param query
     * @param ifSysUser
     * @return
     */
    List<ZyUserVO> getUserByUserAccountOrUserName(@Param("query") String query,@Param("ifSysUser")Boolean ifSysUser);

    /**
     * 获取用户
     * @param query
     * @param queryValue
     * @param ifBindWx
     * @return
     */
    List<ZyUserVO> selectStudentByQueryType(@Param("queryType") StudentQueryEnum query,
                                            @Param("queryValue")String queryValue,
                                            @Param("ifBindWx")Boolean ifBindWx);

    /**
     * 获取用户
     * @param ifSysUser
     * @return
     */
    List<ZyUser> getUserList(@Param("ifSysUser") Boolean ifSysUser);

    /**
     * 获取用户
     * @param userAccounts
     * @return
     */
    List<ZyUser> getByUserAccountList(@Param("userAccounts") List<String> userAccounts);

    /**
     * 获取班级用户
     * @param classId
     * @param userType
     * @return
     */
    List<ZyUser> getClassUser(@Param("classId") Integer classId, @Param("userType")ClassUserTypeEnum userType);

    /**
     * 钉钉id获取用户
     * @param dingTalkId
     * @return
     */
    ZyUser getByDingTalkId(@Param("dingTalkId") String dingTalkId);

    /**
     * 微信id获取用户
     * @param wxUserId
     * @return
     */
    ZyUser getByWxUserId(String wxUserId);

    /**
     * 用户名称模糊搜索
     * @param userName
     * @return
     */
    List<ZyUser> selectUserByNameLike(String userName);

    /**
     * 获取课节用户
     * @param lessonId
     * @param userType
     * @return
     */
    List<ZyUser> getUserByLessonId(@Param("lessonId") Integer lessonId, @Param("userType")ClassUserTypeEnum userType);

    /**
     * 获取插班生
     * @param lessonId
     * @return
     */
    List<ZyUser> getTransferStudentsByLessonId(Integer lessonId);

    /**
     * 每天添加的人数
     * @return
     */
    List<ZyUserVO> getStudentCreateCountGroupByDay();

    /**
     * 用户的逻辑删除
     * @param userAccount
     */
    void deleteUser(String userAccount);

    /**
     * 修改用户的uid
     * @param userAccount
     * @param uId
     */
    void updateUserUid(@Param("userAccount") String userAccount,@Param("uId") String uId);
}